<template>
  <iconfont
    name="#icon-fangda"
    @click="onClick"
    style="font-size: 20px; color: #929292; cursor: pointer"
  />
</template>
<script setup>
import iconfont from '@/components/iconfont.vue'
import { useVModel } from '@vueuse/core'
/**
 * 外部参数
 */
let props = defineProps({
  zoom: { type: Number, default: 1 },
  graph: { required: true },
})
/**
 * 事件定义
 */
let emit = defineEmits(['update:zoom'])
/**
 * 双向绑定
 */
let zoom = useVModel(props, 'zoom', emit)
/**
 * 图
 */
function onClick() {
  props.graph.zoomBy(2)
  zoom.value = props.graph.getZoom()
}
</script>
<style lang="less" scoped></style>
